import ajax from '@/utils/ajax'
import dialog from '@/utils/dialog'
export default function (query) {
  const isDefault = query && query.isDefault
  return ajax({
    url: `/a/address/getAddressList`,
    data: query
  }).then(data => {
    const defData = isDefault ? data.find(v => v.defaultStatus === '0') : data
    return defData
  }).catch(msg => dialog.showToast(msg || '请求失败'))
}
